<%@ page language="java" contentType="text/html; charset=UTF-8"
    pageEncoding="UTF-8"%>
<!DOCTYPE html "-//W3C//DTD XHTML 1.0 Strict//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd">
<html>
 <head>
   <meta http-equiv="content-type" content="text/html; charset=utf-8"/>
   <title></title>
   <script src="http://ditu.google.cn/maps?file=api&v=2&key=ABQIAAAABfEOGxAzfje6hPBY_qDiiBSfqhHulARE8dJ7-cT0beqFVPf8NxQwxY_26X7wtezxbTjtH5jZwthXVw&sensor=true"
           type="text/javascript"></script>
    <script language="javascript" src="js/jquery.js"></script>
    <script language="javascript" src="js/mapinit.js"></script>
    <script language="javascript" src="js/labeledmarker.js"></script>
    <script language="javascript" src="js/zoneloader.js"></script>
    <script language="javascript" src="js/szborder.js"></script>
    <script language="javascript" src="js/pointloader.js"></script>
    <style>
    	* { font-size:12px; }
    </style>
 </head>
 
 <body onload="initialize();" onunload="GUnload()">
 	<script>
 	
 	var map;
	var baseIcon;
	var currLayer = [];
	var currZone = [];
	var d = [];
	var icon = "images/1.gif";
 	var geoXml = null;
 		function initialize() {
     if (GBrowserIsCompatible()) {
       var map= new GMap2(document.getElementById("map_canvas"));
        map.setCenter(new GLatLng(39.9493, 116.3975), 13);
     }
   }

	var map;
	var baseIcon;
	var currLayer = [];
	var currZone = [];
	var d = [];
	var icon = "images/1.gif";
	var gcount = 0;
	
	$(document).resize(function(){ 
		var height = $(document).height();
		$("#map_canvas").height(height);
	});
	
	function doResize(){
		var height = $(document).height();
		$("#map_canvas").height(height);
	}
	
	function clearSearch(){
		
		
		
	}
	
	function doSearch(title,url)
	{
		$("#loadingBar").fadeOut(200);
		
		if (geoXml != null){

				map.removeOverlay(geoXml);

		}
		
 		geoXml = new GGeoXml(url);
 			
 		map.addOverlay(geoXml);

		
	}
	
	function initialize() {
		
		var height = $(document).height();
		$("#map_canvas").height(height);
		
		map= new GMap2(document.getElementById("map_canvas"));
		map.addControl(new GSmallMapControl());
		map.addControl(new GMapTypeControl());
		map.setCenter(new GLatLng(22.543001,114.061089), 11);
		
		//map.openInfoWindow(map.getCenter(),document.createTextNode("ZhiHuiGuan:Tong Yuan Road Information Building Two Floor"));
		
		var loc = new GLatLng(22.543001,114.061089);
		var marker = new GMarker(loc, {
			draggable:true
		});
		GEvent.addListener(marker, "dragstart", function(){
			map.closeInfoWindow();
		});
		GEvent.addListener(marker, "dragend", function(){
			marker.openInfoWindowHtml("正在更新位置...");
		});
		//map.addOverlay(marker);
		//map.openInfoWindow(map.getCenter(),document.createTextNode("深圳市"));
		
		
		
		

		// Create a base icon for all of our markers that specifies the
		// shadow, icon dimensions, etc.
		baseIcon= new GIcon(G_DEFAULT_ICON);
		baseIcon.shadow= "http://www.google.cn/mapfiles/shadow50.png";
		baseIcon.iconSize= new GSize(18, 18);
		baseIcon.shadowSize= new GSize(18, 18);
		baseIcon.iconAnchor= new GPoint(9, 34);
		baseIcon.infoWindowAnchor= new GPoint(9, 2);
		
		
		var url = "http://www.21star.com/map/data/border2.kml";
 			var szborder = new GGeoXml(url);
 			
 			map.addOverlay(szborder);
 			
 			/*
 			geoXml = new GGeoXml("http://www.21star.com/map/data/nanshan.kml");
 			
 			map.addOverlay(geoXml);
 			
 			geoXml = new GGeoXml("http://www.21star.com/map/data/futian.kml");
 			
 			map.addOverlay(geoXml);
 			
 			geoXml = new GGeoXml("http://www.21star.com/map/data/luohu.kml");
 			
 			map.addOverlay(geoXml);
 			
 			geoXml = new GGeoXml("http://www.21star.com/map/data/yantian.kml");
 			
 			map.addOverlay(geoXml);
 			
 			geoXml = new GGeoXml("http://www.21star.com/map/data/baoan.kml");
 			
 			map.addOverlay(geoXml);
 			
 			geoXml = new GGeoXml("http://www.21star.com/map/data/longgang.kml");
 			
 			map.addOverlay(geoXml);
 			
 			geoXml = new GGeoXml("http://www.21star.com/map/data/longhua.kml");
 			
 			map.addOverlay(geoXml);
 			
 			geoXml = new GGeoXml("http://www.21star.com/map/data/dapeng.kml");
 			
 			map.addOverlay(geoXml);
 			
 			geoXml = new GGeoXml("http://www.21star.com/map/data/pingshan.kml");
 			
 			map.addOverlay(geoXml);
 			
 			geoXml = new GGeoXml("http://www.21star.com/map/data/qianhai.kml");
 			
 			map.addOverlay(geoXml);

			geoXml = new GGeoXml("http://www.21star.com/map/data/nanshan_title.kml");
 			
 			map.addOverlay(geoXml);
			
 			*/
		
		//实现滚动缩放
		map.enableScrollWheelZoom();
	}
	
 		
 	
 		$(document).ready(function(){
 				
 			var width = $(document).width();
 			var height = $(document).height();
 			
 			var left = width / 2 - 100;
 			var top = height / 2 - 50;
 			
 			$("#loadingBar").css({"left":left,"top":top});
 			

 			
 		});
 	</script>
 	<div id="loadingBar" style="float:left;z-index:1000;background-color:#ffffff;display:none;width:200px;height:50px;padding-left:10px;padding-top:10px;text-align:center;position:absolute;left:100px;top:100px">
 	<img src="images/loading.gif" /><br />正在加载...
 	</div>
   <div id="map_canvas" style="width: 100%; height: 600"></div>
 </body>
</html>
   